import Vue from 'vue'
import Vuex from 'vuex'

import createPersistedState from "vuex-persistedstate"
import shoppingStore from './shoppingStore'
import  myaddressStore from  "./addressStore";

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    flag:true,//控制导航是否显示
  },
  getters: {
  },
  mutations: {
    changeFlag(state,payload){
      state.flag = payload;
    }
  },
  actions: {
  },
  modules: {
    shoppingStore,
    myaddressStore
  },
  plugins:[
    //默认是本地存储
    //createPersistedState()
    //设置会话存储
    createPersistedState(
      {
        storage:sessionStorage
      }
    )]

})
